<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%
	String basePath = request.getContextPath();
	String path = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+basePath+"/";
	request.setAttribute("path",path);
%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no"/>
	<meta name="format-detection" content="telephone=no,address=no,email=no"/>
	<meta name="keywords" content="" />
	<meta name="description" content="" />
	<title>选择收货地址</title>
	<script type="text/javascript" src="${path}/mobileTerminal/js/jquery.js"></script>
	<script type="text/javascript" src="${path}/js/jquery-2.1.1.min.js"></script>
	<link href="${path}/mobileTerminal/css/style.css" rel="stylesheet" media="all">
	<link rel="shortcut icon" href="${path}/mobileTerminal/img/favicon.png">
</head>
<script type="application/javascript">
    function addressDefault() {
        var ad=$("input[type='radio']:checked").val()
        $("#adSelect").val(ad)
        document.getElementById('form2').submit()
    }
</script>
<body class="hu_shopping">
	<header>
		<div class="headerwrap">
			<div class="header_wrap">
				<a href="javascript:history.go(-1);" class="return_last">返回</a>
				<h1>选择收货地址</h1>
				<a class="return_lasts"onclick="addressDefault()">默认</a>
			</div>
		</div>
	</header><!-- header -->
	<div class="content_wrap" id="addselect_wrap">
		<div class="add_select">
			<ul class="addselect_ul">
				<c:forEach items="${addressList}" var="items">
				<li>
					<label>
						<div class="addselect_top">
							<p class="addselect_name">${items.addressee}</p>
							<p class="addselect_phone">${items.addressPhone}</p>
							<div class="clear"></div>
						</div><!-- addselect_top -->
						<span>${items.detailed} </span>
						<c:if test="${items.id == addressId}">
							<input name="ad" type="radio" value="${items.id}" checked>
						</c:if>
						<c:if test="${items.id != addressId}">
							<input name="ad" type="radio" value="${items.id}">
						</c:if>
						<a class="addselect_a" href="${path}/editAddress?addressId=${items.id}&&userId=${userId}">编辑</a>
						<a class="addselect_a" href="${path}/deleteAddresses?addressId=${items.id}&&userId=${userId}">删除</a>
						<div class="clear"></div>
					</label>
				</li>
				</c:forEach>
				<c:if test="${size==0}">
					<div class="none_cont">
						<img src="${path}/mobileTerminal/img/no_bg_13.png">
					</div>
				</c:if>
			</ul><!-- addselect_ul -->
			<%--<div class="otherBtns">
				<c:choose>
					<c:when test="${page.pageNo != page.totalPages}">
						<a class="nextpage" value="点击加载更多"  href="${path}/addressList?pageNo=${page.nextPageNo}">点击加载更多</a>
					</c:when>
					<c:otherwise>
						&lt;%&ndash;<a class="nextpage" value="点击加载更多" >点击加载更多</a>&ndash;%&gt;
					</c:otherwise>
				</c:choose>
			</div>--%>
		</div><!-- add_select -->
	</div><!-- content_wrap -->
	<form id="form2" name="form2" method="post" action="${path}/addressList?userId=${userId}">
		<input id="adSelect" name="adSelect" style="display: none" value="">
	</form>
	<div class="addselect_bottom">
		<a href="${path}/toSaveAddress?userId=${userId}">新增地址</a>
	</div><!-- go_collectionbuy -->


	<div class="footer_copyright h35">
		<p>苏州知行合一网络科技有限公司提供技术支持</p>
	</div><!-- footer_copyright -->
</body>
</html>